import {FormRuleUtil} from "@/utils";



export const MENU_EDIT = {
    BODY: {

        meta: {
            title: null,
            icon: null,
            badge: null,
            dot: false,
            hiddenInTab: false,
            hiddenInMenu: false,
            enableKeepAlive: true,
            dynamicNewTab: true,
            description: null,
            iframe: null,
            groupMode: false,
        },
        component: '',
        name: '',
        parentId: null,
        path: '',
        redirect: '',
        apiTokens: [],
        sort: 50,
    },
    RULES: {
        meta: {
            title: FormRuleUtil.strRule('菜单标题', true, 10),
            description: FormRuleUtil.strRule('页面简介', false, 255),

            icon: FormRuleUtil.strRule('页面图标', true, 50),
            groupMode: FormRuleUtil.boolRule('展示模式', true),
            iframe: FormRuleUtil.strRule('请填写正确的网页地址', false, 0, 'url'),
        },
        redirect: FormRuleUtil.strRule('页面重定向', false, 255),
        parentId: FormRuleUtil.strRule('上级菜单', true),
        path: FormRuleUtil.strRule('菜单路径', true, 400),
        component: FormRuleUtil.strRule('组件路径', true, 100),
        name: FormRuleUtil.strRule('组件名称', true, 100),
        sort: FormRuleUtil.numRule('显示排序', false, 0, 9999),
    }
}

// 数据字典明细 表单对象
export const DICT_ITEM_EDIT = {
    BODY: {
        disabled: false,
        label: null,
        sort: 0,
        theme: 'text',
        value: null
    },
    RULES: {
        label: FormRuleUtil.strRule('选项文本', true),
        value: FormRuleUtil.strRule('选项值', true),
        theme: FormRuleUtil.strRule('样式风格', true),
        disabled: FormRuleUtil.boolRule('可选状态', true,),
        sort: FormRuleUtil.numRule('显示排序', true),
    }
}


export const DICT_EDIT = {
    BODY: {
        code: "",
        title: "",
        description: "",
        items: [],
        state: "",
    },
    RULES: {
        code: FormRuleUtil.strRule("字典代码", true, 30, "abc"),
        title: FormRuleUtil.strRule("字典名称", true, 30),
        description: FormRuleUtil.strRule("字典描述", false, 500),
        state: FormRuleUtil.strRule("字典状态", true, 100),
        items: FormRuleUtil.arrayRule("字典描述", true),


    }
}

export const MODULE_EDIT = {
    BODY: {
        code: null,
        description: null,
        hasWeb: true,
        name: null,
        icon: null,
        pkgName: null,
        releaseVersion: null,
        sort: 0,
        state: null
    },
    RULES: {
        code: FormRuleUtil.strRule("模块代码", true, 30, "abc"),
        description: FormRuleUtil.strRule("模块描述", false, 500),
        hasWeb: FormRuleUtil.boolRule("前端属性", true),
        name: FormRuleUtil.strRule("模块名称", true, 10),
        icon: FormRuleUtil.strRule("模块图标", true),
        pkgName: FormRuleUtil.strRule("所在包名", true, 100),
        releaseVersion: FormRuleUtil.strRule("模块版本", true, 30),
        sort: FormRuleUtil.numRule("显示排序值", true),
        state: FormRuleUtil.strRule("模块状态", true, 100)

    }
}


export const API_EDIT = {
    BODY: {
        expr: null,
        level: null,
        module: {code: null},
        sort: 0,
        state: null,
        title: null,


    },
    RULES: {
        title: FormRuleUtil.strRule("权限标题", true, 8),
        module: {code: FormRuleUtil.strRule("所属模块", true, 30)},
        expr: FormRuleUtil.strRule("权限表达式", true, 50),
        state: FormRuleUtil.strRule("权限状态", true, 100),
        level: FormRuleUtil.strRule("安全级别", true, 100),
        sort: FormRuleUtil.numRule("显示排序值", true),

    }
}


export const CONFIG_EDIT = {
    BODY: {
        "code": "",
        "description": "",
        "items": [],
        "sort": 0,
        "state": "",
        "title": ""
    },
    RULES: {
        "code": FormRuleUtil.strRule("配置代码", true, 8, "code"),
        "title": FormRuleUtil.strRule("配置名称", true, 8),
        "description": FormRuleUtil.strRule("配置描述", true, 255),
        "items": FormRuleUtil.arrayRule("配置明细", true),
        "sort": FormRuleUtil.numRule("显示排序值", true, 0, 100),
        "state": FormRuleUtil.strRule("配置状态", true, 8),


    }
}


export const CONFIG_ITEM_EDIT = {
    BODY: {
        code: "",
        name: "",
        value: '',
        description: "",
        allowEdit: true,
        allowDel: false,
    },
    RULES: {
        allowEdit: FormRuleUtil.boolRule("编辑权限", true),
        allowDel: FormRuleUtil.boolRule("删除权限", true),
        code: FormRuleUtil.strRule("参数代码", true, 8),
        name: FormRuleUtil.strRule("参数名称", true, 8),
        value: FormRuleUtil.strRule("参数值", true, 8),
        description: FormRuleUtil.strRule("参数描述", false, 200),
    },
}
